from flask import Flask, render_template, request, jsonify
from flask_predict import *

app = Flask(__name__)


@app.route('/')
def index():
    return render_template('index2.html')


@app.route('/ask', methods=['PosT'])
def ask():
    data = request.get_json()
    user_input = data.get('user_input', '')
    response = model_predict(user_input)
    return jsonify({'answer': response})


if __name__ == '__main__':
    app.run(debug=True)
